package cn.buk.tms.dao;

import cn.buk.tms.entity.misc.ProductBought;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: yfdai
 * Date: 14-4-18
 * Time: 下午12:38
 * To change this template use File | Settings | File Templates.
 */
public interface ProductBoughtDao {

    int create(ProductBought productBought);

    List<ProductBought> findAll();

    int update(ProductBought productBought);

    ProductBought getById(int id);

    ProductBought getByProductId(int productId, int enterpriseId);
    ProductBought getByProductCode(int enterpriseId, String  productCode);

    int decProductBoughtCount(int enterpriseId, int id, int count);

    ProductBought getOrCreateProductBought(int enterpriseId, String productCode, int boughtCount, int expireDays);
}
